home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / sysadmin.290 < prev    next >
Text File  |  1992-02-06  |  11KB  |  285 lines

  1. {\rtf0\ansi{\fonttbl\f2\fnil Times-Roman;\f0\fmodern Courier;}
  2. \paperw12940
  3. \paperh7740
  4. \margl120
  5. \margr640
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx1240\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\f2\b0\i0\ul0\fs28 disk partition file system filesystem export exportfs\
  8. \
  9. Q: Please outline the procedure for repartitioning a SCSI disk (if possible).  I would like to create an additional partition so that I may export a file system to a specific machine with specific privileges.\
  10. \
  11. A: Note that under both Release 2.0 and Release 2.1 
  12. \b BuildDisk
  13. \b0  now provides an option on some disks for building a one-partition or a two-partition disk.  If doing a new 
  14. \b BuildDisk
  15. \b0  is an option, that is by far the easiest way to do this.\
  16. \
  17. But, let's assume you can't do this (either because you're still running 1.0 or 1.0a, or because it's just not applicabable in your situation).\
  18. \
  19. If the only thing you want to do is to export a subdirectory, without exporting the parent directory to 
  20. \i any
  21. \i0  machine, you can put an entry like\
  22. \
  23.  
  24. \pard\tx1240\tx2480\tx4040\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\f0\fs24\fi20\li1800 /subdirectory    -ro,access=othermachine\
  25.  
  26. \pard\tx1240\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\f2\fs28 \
  27. If 
  28. \b /subdirectory
  29. \b0  is in the same file system as 
  30. \b /
  31. \b0 , and if 
  32. \b /
  33. \b0  is not exported also, then this is all you need to do: only the machine 
  34. \b othermachine
  35. \b0  will be able to mount 
  36. \b /subdirectory
  37. \b0 , and access will be read-only.\
  38. \
  39. If you're also exporting a parent directory, with different access, you'll have to build a separate file system.\
  40. \
  41. The file 
  42. \b /etc/disktab
  43. \b0  contains the characteristics of the various disk types pre-defined by the system.  The comments at the front of 
  44. \b disktab
  45. \b0  are fairly descriptive (if you've questions, check the UNIX Manual pages, or contact your appropriate support folks).  In Releases 1.0 and 1.0a, any disk you attach to the system must have an appropriate entry in 
  46. \b disktab
  47. \b0 ; in Releases 2.0 and 2.1, the disk initialization utilities can craft a 
  48. \b disktab
  49. \b0  entry (for a disk with one partition) on the fly.  But, if you want a partitioning scheme other than the default, you'll still need to build a 
  50. \b disktab
  51. \b0  entry even in 2.0 and 2.1.\
  52. \
  53. Note also that you may have to repeat this when you upgrade to a new release using 
  54. \b BuildDisk
  55. \b0 : the 
  56. \b BuildDisk
  57. \b0  procedure does not preserve your current disk layout.\
  58. \
  59. What you'll need to do is:\
  60. \
  61.  
  62. \pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 1.    Copy the 
  63. \b disktab
  64. \b0  entry for the way the drive is currently configured.  The name of the 
  65. \b disktab
  66. \b0  entry used for the drive can be determined by using the 
  67. \b /usr/etc/disk
  68. \b0  program: the program displays the name of the 
  69. \b disktab
  70. \b0  entry used just after it starts.  It'll look something like:\
  71.  
  72. \pard\tx1240\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480 \
  73.  
  74. \f0\fs24\li980 rhino-66# 
  75. \b /usr/etc/disk /dev/rsd0a
  76. \b0 \
  77. disk name: MAXTOR XT-8760S-512\
  78. disk type: fixed_rw_scsi\
  79. Disk utility\
  80. \
  81. disk> 
  82. \b quit
  83. \b0 \
  84.  
  85. \f2\fs28\li0 \
  86.  
  87. \pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\li540 The final line in the stuff above is the prompt from the disk program, and the input 
  88. \b quit
  89. \b0  to exit.  Note that this was run as root.  Note also the 
  90. \b disk name:
  91. \b0  line — that has the key info describing which disktab entry you'll copy. (The 
  92. \b ?
  93. \b0  or 
  94. \b help
  95. \b0  command will list all the commands for disk.)\
  96.  
  97. \pard\tx660\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi20\li700 \
  98.  
  99. \pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\li540 If there's no 
  100. \b disktab
  101. \b0  entry for your disk, you'll have to build one.  The 
  102. \b disk
  103. \b0  command can be used to obtain the information related to the physical configuration of the drive:\
  104. \
  105.  
  106. \pard\tx1440\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\f0\fs24\li780\fc0 rhino-67# 
  107. \b /usr/etc/disk /dev/rsd1a
  108. \b0 \
  109. disk name: MAXTOR XT-8760S-1024\
  110. disk type: fixed_rw_scsi\
  111. Disk utility\
  112. \
  113. disk> 
  114. \b label
  115. \b0 \
  116. label information: print, write? 
  117. \b print
  118. \b0 \
  119. current label information on disk:\
  120. disk label version #3\
  121. disk label: ExternalDisk\
  122. disk name: XT-8760S-1024-ALL\
  123. disk type: fixed_rw_scsi\
  124. ncyls 1626 ntrack 16 nsect 26 rpm 3600\
  125. sector_size 1024 front_porch 160 back_porch 0\
  126. ngroups 0 ag_size 0 ag_alts 0 ag_off 0\
  127. boot blocks: #1 at 32 #2 at 96 \
  128. bootfile: sdmach\
  129. host name: nescorna\
  130. root partition: a\
  131. part   base   size bsize fsize cpg density minfree newfs optim automount type\
  132. a         0 676256  8192  1024  32    4096     10%   yes  time        no 4.3BSD\
  133. disk> 
  134. \b quit\
  135. \
  136.  
  137. \pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\f2\b0\fs28\li540 With the information in the output from 
  138. \b disk
  139. \b0  and the information in the UNIX Manual Page for the 
  140. \b disk
  141. \b0  command, build a 
  142. \b disktab
  143. \b0  entry with the appropriate drive paramters and partition layout.\
  144. \
  145.  
  146. \fi-280 2.    Modify the partition information so it describes the layout you want.  Unlike numerous other UNIX and disk systems, it doesn't matter whether you start a partition on a track or cylinder boundary, or not.  If you 
  147. \i don't
  148. \i0  use such boundaries, you might waste a little space (check for messages from 
  149. \b mkfs
  150. \b0 ).  It is important that the only things you change are the partition-specific information, and the name of the 
  151. \b disktab
  152. \b0  entry.\
  153. \
  154. 3.    Save the new 
  155. \b disktab
  156. \b0  entry as part of the 
  157. \b disktab
  158. \b0  file.\
  159. \
  160. 4.    Backup anything on the disk that isn't stored elsewhere.\
  161. \
  162. 5.    Boot from another device (we'll use an optical disk in this example).  Become root.  Save the original 
  163. \b disktab 
  164. \b0 file that's on the OD (rename it to, for example, 
  165. \b /etc/disktab.ORIG
  166. \b0 ).  Copy the 
  167. \b disktab
  168. \b0  file from the SCSI, after mounting its partition a (this is the modified 
  169. \b disktab
  170. \b0  you created in Steps 2 and 3).  Unmount the SCSI disk.\
  171. \
  172. 6.    Run the 
  173. \b disk
  174. \b0  command, using it the -t option.  E.g., if your 
  175. \b disktab
  176. \b0  entry is called 
  177. \i XT-8760S-512-mod
  178. \i0 :\
  179.  
  180. \pard\tx1240\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480 \
  181.  
  182. \pard\tx1440\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\f0\fs24\li780 rhino-2# 
  183. \b /usr/etc/disk -t 
  184. \i XT-8760S-512-mod
  185. \b0\i0 \
  186.  
  187. \pard\tx1240\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\f2\fs28 \
  188.  
  189. \pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 7.    Write a new label, which will incorporate the changes you've made to the 
  190. \b disktab
  191. \b0  entry.
  192. \pard\tx1240\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480 \
  193. \
  194.  
  195. \pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 8. If you're changing the entire disk layout — if dividing a one-partition disk into two partitions, or if you're reallocating some of the space from Partition A — you'll want to use 
  196. \b disk
  197. \b0 's 
  198. \b init
  199. \b0  command.  This will prepare the disk for placing your data back on it.  When you're done, exit 
  200. \b disk
  201. \b0 .\
  202. \
  203.  
  204. \fi0 Alternatively, you might simply be splitting Partition B into two pieces.  In this case, since you're not changing Partition A, you don't have to reinitialize the entire disk.  You can simply build the new partitions, using 
  205. \b newfs
  206. \b0 .  Exit 
  207. \b disk
  208. \b0 , and run 
  209. \b newfs
  210. \b0 , as in the following example (which is for a Partition C):\
  211.  
  212. \pard\tx1240\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480 \
  213.  
  214. \pard\tx1440\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\f0\fs24\li780 rhino-3# 
  215. \b /usr/etc/newfs -n -v /dev/rsd0c
  216. \b0 \
  217.  
  218. \pard\tx1240\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\f2\fs28 \
  219.  
  220. \pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\li540 The 
  221. \b -n
  222. \b0  option tells 
  223. \b newfs
  224. \b0  not to install a boot program (it's harmless in these cases if you 
  225. \i do
  226. \i0  install one; likewise if you don't -- one's already installed).  The 
  227. \b -v
  228. \b0  option is for verbose: 
  229. \b newfs
  230. \b0  reports more of what it's doing (
  231. \b -v
  232. \b0  is optional, depending on how much stuff you want to see).  The 
  233. \b newfs
  234. \b0  program will write the superblock, initialize the i-nodes and the bitmaps, initialize the root directory of the file system, and create a 
  235. \b lost+found
  236. \b0  directory.\
  237.  
  238. \pard\tx1240\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480 \
  239.  
  240. \pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 9. Mount the new partitions and restore the backed-up file system from Step 4, above (using 
  241. \b /usr/etc/restore
  242. \b0 ; see the UNIX Manual page).\
  243. \
  244. 10. On the SCSI (Partition A), modify the file in 
  245. \b /etc/exports
  246. \b0 , adding the file system you created.  Likewise, modify 
  247. \b /etc/fstab
  248. \b0  (there's no need to modify NetInfo's 
  249. \b /mounts
  250. \b0  directory: NetInfo isn't running when the local file systems are mounted).\
  251. \
  252.  
  253. \pard\tx620\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 11.    Reboot the system.  Check to be sure everything is OK.  Note 
  254. \pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 that the 
  255. \b exportfs
  256. \b0  command will print the current state of what's
  257. \pard\tx620\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540  
  258. \pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 exported, if you invoke it with no arguments.\
  259.  
  260. \pard\tx1240\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480 \
  261. If you want to change the size of the A partition, things get 
  262. \i much
  263. \i0  more complicated, because you have to do a new 
  264. \b BuildDisk
  265. \b0 .  Because you've customized the disk, you'll have to give 
  266. \b BuildDisk
  267. \b0  the information it needs to find your new disktab entry.  This involves either faking out 
  268. \b BuildDisk
  269. \b0 , by actually modifying the primary disktab entry for your disk (rather than creating a new one), or using the shell script in 
  270. \b /usr/etc/builddisk
  271. \b0 .  Note that there's no documentation for this script; it's direct use is not supported\
  272. \
  273. We encourage you — 
  274. \i very strongly
  275. \i0  — to use only space from Partition B, and that Partition A is left alone.  If you really feel you 
  276. \i must
  277. \i0  change Partition A too,  contact your appropriate technical support staff.\
  278. \
  279. QA290\
  280. \
  281. Valid for 1.0 \
  282. Valid for 2.0 \
  283. \
  284.  
  285.